package com.villaday.idf.activity;

import android.text.TextUtils;

import com.villaday.idf.R;
import com.villaday.idf.base.BaseActivity;
import com.villaday.idf.util.Constant;
import com.villaday.idf.util.LogeUtil;
import com.villaday.idf.util.OkHttpUtil;

public class ErWeiMaActivity extends BaseActivity implements OkHttpUtil.OnDataListener {

    private String materialId;

    @Override
    protected int getViewResId() {
        return R.layout.activity_er_wei_ma;
    }

    @Override
    protected void loadData() {
        materialId = getIntent().getStringExtra("materialId");
        /*HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("modelType",)*/
        OkHttpUtil.getJSON(this, String.format(Constant.URL.material_posters, materialId), this);

    }

    @Override
    public void onResponse(String url, String json) {
        if (!TextUtils.isEmpty(json)) {
            if (String.format(Constant.URL.material_posters, materialId).equals(url)) {
                LogeUtil.e("material_posters", json);
            }
        }
    }

    @Override
    public void onFailure(String url, String error) {

    }
}
